From: kfraser@localhost.localdomain Date: Tue, 11 Sep 2007 12:41:15 +0000 (+0100) Subject: Fix memory leak in xend X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14978 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=337e2014c73b7fd7dba693222fcd91bb40d8a42b;p=xen.git Fix memory leak in xend I found that xend's memory usage grows considerably when running a script such as while true; do xm new foo ; sleep 2s; xm delete foo ; sleep 2s; done XendAPIStore maintains a list of class instances and in the case of new/create operation, an associated VMMetrics object is stashed in the list but never removed on delete/shutdown. This patch removes the instance by invoking XendBase.destroy() method. Signed-off-by: Jim Fehlig --- diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 083fd2464d..6ceea45e08 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -1088,6 +1088,7 @@ class XendDomain: log.info("Domain %s (%s) deleted." % (dominfo.getName(), dominfo.info.get('uuid'))) + dominfo.metrics.destroy() self._managed_domain_unregister(dominfo) self._remove_domain(dominfo) XendDevices.destroy_device_state(dominfo)